package com.magist.manage.web.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.magist.core.entity.Page;
import com.magist.core.service.SimpleServiceImpl;
import com.magist.manage.web.dao.UserLoginMapper;
import com.magist.manage.web.entity.UserLogin;
import com.magist.manage.web.service.UserLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class UserLoginServiceImpl extends SimpleServiceImpl<UserLogin> implements UserLoginService {

	@Autowired
	private UserLoginMapper userLoginMapper;

	@Override
	public PageInfo<UserLogin> page(Example example, Page page) {
    	PageHelper.startPage(page.getCurrPage(), page.getLimit());
    	List<UserLogin> list = this.find(example);
        PageInfo<UserLogin> pageInfo = new PageInfo(list);
		return pageInfo;
	}
}